<extend name="Base/common"/>
<block name="style">
    <link href="__CSS__/event.css" rel="stylesheet" type="text/css"/>
    <link href="__ZUI__/lib/datetimepicker/datetimepicker.min.css" rel="stylesheet" type="text/css">
</block>
<block name="body">
	<style>
		.boxShadowBorder{
			box-shadow: 0 0 0 !important;
			border:0 !important
		}
		.btn-primary{
			background-color:#8DCB20;
			border-color: #8DCB20;
		}
	</style>
   		<!--大banner图-->
		<div class="m-banner am-cf"><img src="__PUBLIC__/images/banner1.jpg"></div>
		<!--大banner图-->
		<div class="container  index-news con-color am-cf index-project-mp index-project">
    
           	<!--副标题-->
            <div class="path am-padding-1-sm am-padding-horizontal-md am-padding-horizontal-lg am-margin-bottom am-cf">
                <div class="subtitle  am-u-sm-12 am-u-md-6 am-u-lg-6 am-padding-0-sm">
                    <strong>V</strong>
                    <h3>志愿者<span>管理中心</span></h3>
                    <p>
                        志/愿/青/春&nbsp;爱/我/寿/光<br/>
                        OLUNTEER PROJECT
                    </p>
                </div>
                <include file="Public/detail_login"/>
               
            </div>
            <!--副标题-->
          	<!--左侧导航菜单-->
            <div class="am-cf news-detail am-padding-0">
                <include file="Public/base"/>
                <!--左侧导航菜单-->
                <!--右侧内容区-->
                <div class="content am-u-sm-12 am-u-md-9 am-u-lg-9 white-popup1 boxShadowBorder" id="frm-post-popup">
                    <div class="sidebar-title-r">发起活动</div>             		
				        <div class="aline" style="margin-bottom: 35px"></div>
				        <div>
				            <div class="row">
				                <div style="padding: 0 10px;width: 270px;float: left;">
				                    <div class="controls">
				                        <input type="file" id="upload_picture_cover" >
				                        <div class="upload-img-box" style="margin-top: 20px;width: 250px">
				                            <div style="font-size:3em;padding:2em 0;color: #ccc;text-align: center">{:L('_NO_COVER_')}</div>
				                        </div>
				                    </div>
				
				                </div>
				                <div class="col-xs-12">
				                    <form class="form-horizontal ajax-form" role="form" action="{:U('Event/Index/doPost')}"
				                          method="post">
				                        <div class="form-group has-feedback">
				                            <label for="title" class="control-label">{:L('_TITLE_')}</label>
				
				                            <div class="col-xs-10">
				                                <input id="title" name="title" class="form-control form_check" check-type="Text" value="" placeholder="{:L('_TITLE_')}" required />
				                            </div>
				                            <input type="hidden" name="id" id="id" value=""/>
				                            <input type="hidden" name="cover_id" id="cover_id_cover" value=""/>
				                        </div>
				
				
				                        <div class="form-group ">
				                            <label for="type_id" class="control-label">{:L('_CATEGORY_')}</label>
				
				                            <div class="col-xs-5">
				                                <select id="type_id" name="type_id" class="form-control ">
				                                    <volist name="tree" id="top">
				                                        <option value="{$top.id}" >
				                                        {$top.title}
				                                        </option>
				                                    </volist>
				                                </select>
				                            </div>
				
				
				                        </div>
				
				
				                        <div class="form-group  has-feedback">
				                            <label for="" class="control-label">{:L('_TIME_')}</label>
				
				                            <div class="col-xs-5">
				                                <input type="text" id="sTime" name="sTime" class="time_d form-control form_check" readonly check-type="Date" value="" placeholder="{:L('_TIME_START_')}" required/>
				                            </div>
				
				                            <div class="col-xs-5">
				                                  <input type="text" id="eTime" name="eTime" class="time_d form-control form_check" readonly check-type="Date"  value="" placeholder="{:L('_TIME_OVER_')}" required/>
				                            </div>
				                        </div>
				                        <div class="form-group  has-feedback">
				                            <label for="address" class="control-label">{:L('_ADDRESS_')}</label>
				
				                            <div class="col-xs-10">
				                                <input id="address"  name="address" class="form-control form_check" check-type="Text" value="" placeholder="{:L('_ADDRESS_')}" required/>
				
				                            </div>
				
				                        </div>
				                        <div class="form-group  has-feedback">
				                            <label for="limitCount" class="control-label">{:L('_PEOPLE_NUMBER_')}</label>
				
				                            <div class="col-xs-10">
				                                <input id="limitCount" name="limitCount" class="form-control form_check" check-type="Num"  value="" placeholder="{:L('_PEOPLE_NUMBER_')}" required />
				                            </div>
				
				                        </div>
				                        <div class="form-group  has-feedback">
				                            <label for="deadline" class="control-label">{:L('_DEADLINE_')}</label>
				
				                            <div class="col-xs-10">
				                                <input type="text" id="deadline" name="deadline" readonly class="time form-control form_check " check-type="Text" value="" placeholder="{:L('_DEADLINE_REGISTRATION_')}" required/>
				                            </div>
				
				                        </div>
				                        <div class="form-group">
				                            <label for="explain" class="control-label">{:L('_INTRODUCTION_')}</label>
				
				                            <div class="col-xs-10">
				                                <php>
				                                    $config="toolbars:[['source','|','bold','italic','underline','fontsize','forecolor','justifyleft','fontfamily','attachment','|','map','emotion','insertimage','insertcode']]";
				                                </php>
				
				                                {:W('Common/Ueditor/editor',array('myeditor_edit','explain','','100%','250px',$config))}
				                            </div>
				                        </div>
				                        <div class="form-group">
				                            <div class="col-xs-6" style="text-align:right">
				                                <button type="submit" class="btn btn-primary " href="{:U('Event/Index/doPost')}" style="padding: 5px 20px 5px 32px;letter-spacing: 12px;font-size: 14px;">{:L('_SUBMIT_')}
				                                </button>
				
				                            </div>
				                            <div class="col-xs-6">
				                                <button onclick="history.go(-1);" class="btn btn-default " href="{:U('Event/Index/doPost')}" style="padding: 5px 20px 5px 32px;letter-spacing: 12px;font-size: 14px;">{:L('_RETURN_')}
				                                </button>
				                            </div>
				
				                        </div>
				                    </form>
				                </div>
				            </div>				
				        </div>
                    <!--组织列表-->
                    
                </div>
            </div>
           
           
           <!--右侧内容区-->
		</div>
    <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <link href="__CORE_CSS__/form_check.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="__CORE_JS__/form_check.js"></script>
    <script type="text/javascript" src="__ZUI__/lib/datetimepicker/datetimepicker.min.js" charset="UTF-8"></script>

    <script>
        $("#upload_picture_cover").uploadify({
            "height": 30,
            "swf": "__STATIC__/uploadify/uploadify.swf",
            "fileObjName": "download",
            "buttonText": "{:L('_UPLOAD_COVER_')}",
            "buttonClass": "uploadcover",
            "uploader": "{:U('Core/File/uploadPicture',array('session_id'=>session_id()))}",
            "width": 250,
            'removeTimeout': 1,
            'fileTypeExts': '*.jpg; *.png; *.gif;',
            "onUploadSuccess": uploadPicturecover,
            'overrideEvents': ['onUploadProgress', 'onUploadComplete', 'onUploadStart', 'onSelect'],
            'onFallback': function () {
                alert("{:L('_NOT_DETECTED_')}");
            }, 'onUploadProgress': function (file, bytesUploaded, bytesTotal, totalBytesUploaded, totalBytesTotal) {
                $("#cover_id_cover").parent().find('.upload-img-box').html(totalBytesUploaded + ' bytes uploaded of ' + totalBytesTotal + ' bytes.');
            }, 'onUploadComplete': function (file) {
                //alert('The file ' + file.name + ' finished processing.');
            }, 'onUploadStart': function (file) {
                //alert('Starting to upload ' + file.name);
            }, 'onQueueComplete': function (queueData) {
                // alert(queueData.uploadsSuccessful + ' files were successfully uploaded.');
            }
        });
        function uploadPicturecover(file, data) {
            var data = $.parseJSON(data);
            var src = '';
            if (data.status) {
                $("#cover_id_cover").val(data.id);
                src = data.url || data.path
                $('.upload-img-box').html(
                        '<div class="upload-pre-item"><img src="' + src + '"/></div>'
                );
            } else {
                toast.error('{:L("_UPLOAD_FAIL_")}', '{:L("_TIP_GENTLE_")}');
            }
        }


        $('.time').datetimepicker({
            language:'zh-CN',
            weekStart:1,
            todayBtn:1,
            autoclose:1,
            todayHighlight:1,
            startView:2,
            minView:0,
            forceParse:0,
            format: 'yyyy-mm-dd hh:ii'
        });

        $('.time_d').datetimepicker({
            language:'zh-CN',
            weekStart:1,
            todayBtn:1,
            autoclose:1,
            todayHighlight:1,
            startView:2,
            minView:2,
            forceParse:0,
            format: 'yyyy-mm-dd'
        });
    </script>
</block>